home *** CD-ROM | disk | FTP | other *** search
- /*
- * Copyright 1991, 1992, 1993, 1994, Silicon Graphics, Inc.
- * All Rights Reserved.
- *
- * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
- * the contents of this file may not be disclosed to third parties, copied or
- * duplicated in any form, in whole or in part, without the prior written
- * permission of Silicon Graphics, Inc.
- *
- * RESTRICTED RIGHTS LEGEND:
- * Use, duplication or disclosure by the Government is subject to restrictions
- * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
- * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
- * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
- * rights reserved under the Copyright Laws of the United States.
- */
-
- #include "generic.h"
- #include "gizmo.h"
- #include <stdio.h>
- #include <gl.h>
- #include <device.h>
- #include <getopt.h>
- #include "parse.h"
-
- void mainloop(), drawgeom();
-
- extern int gd;
- void recalcsizes(), deleteallbuts(), initshowcaseui(), drawui();
-
- void handleredraw()
- {
- getwindowinfo();
- remakepulldown();
- recalcsizes();
- drawgeom(); drawgeom();
- deleteallbuts();
- initshowcaseui();
- viewport(0, (short)(xsize - 1), 0, (short)(ysize - PULLDOWNHEIGHT -1));
- ortho2(-0.5, xsize-0.5, -0.5, ysize-PULLDOWNHEIGHT-0.5);
- drawui();
- }
-
- long readgeometry(char *);
- long insertgeometry(char *);
- void clearbuffer();
- void generichelp();
- void quit();
-
- /* You've got to fill in slots in this structure with the application-
- * specific routine names. If you don't have a routine, just put zero
- * in the slot. You had better have a readfile and writefile, at least.
- *
- * readfile() takes the file name, reads the contents into your
- * internal data structures, and returns 1 if successful; 0 otherwise.
- *
- * writefile() writes a file with the given name, and returns 1 if
- * successful; zero otherwise.
- *
- * errorwritefile() writes the file after a signal is caught. This
- * routine can be the same as writefile(), but you may want something
- * more robust or different, since when this routine gets hit, there
- * was probably a bad error.
- *
- * insertfile() adds the contents of the named file to the application's
- * internal data structures.
- *
- * printfile() prints. The application creates a print file with the
- * given name, and then issues an 'lp' command, or whatever's appropriate.
- *
- * makecheckpointname() creates the name of the checkpoint files. By
- * default, the file named 'foo' has a checkpoint name of 'foo.ckp'. You
- * may want to strip extensions, etc.
- *
- * makebackupname() same as above, but for backup files. The default
- * backup name for 'foo' is 'foo.bak'.
- *
- * clearbuffer() clears the application's data structures after something
- * like a New command.
- *
- * help() presents help (or indicates that none is available).
- *
- * quit() cleans up stuff before quitting.
- */
-
- struct application_entries entries = {
- readgeometry,
- printall,
- printall,
- insertgeometry,
- dumpPostScript,
- 0,
- 0,
- clearbuffer,
- generichelp,
- quit
- };
-
- void generichelp()
- {
- fprintf(stderr, "No help available\n");
- }
-
- void restore255();
-
- void quit()
- {
- drawmode(PUPDRAW); color(0); clear(); drawmode(NORMALDRAW);
- restore255();
- murdergizmos();
- }
-